// import { createProdMockServer } from 'vite-plugin-mock/es/createProdMockServer';
// import { createProdMockServer } from 'vite-plugin-mock/es/client.mjs';
import { createProdMockServer } from 'vite-plugin-mock/client';

const modules = import.meta.glob('./**/*.ts', { eager: true });

const mockModules: any[] = [];
Object.keys(modules).forEach(key => {
	if (key.includes('_')) {
		return;
	}
	// @ts-ignore
	mockModules.push(...modules[key].default);
});

export function setupProdMockServer() {
	createProdMockServer(mockModules);
}
